import React, { Component } from 'react'
import PubSub from 'pubsub-js'
import Son from './Son'
export default class Far extends Component {
  componentDidMount() {
    PubSub.subscribe('car', (topic, data) => {
      console.log('far接收', topic, data)
    })
  }
  render() {
    return (
      <div>
        Far
        <button
          onClick={() => {
            PubSub.publish('richFemale', '猫女士：110')
          }}
        >
          发布富婆话题
        </button>
        <hr />
        <Son></Son>
      </div>
    )
  }
}
